﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GetData.aspx.cs" Inherits="posttracker.GetData" %>

<%@ Register Src="~/Controls/ControlDisplyingData.ascx" TagName="ControlDisplyingData" TagPrefix="tmp" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {

            $("Button1").click(function() {
                var id = this.val();
                $.getJSON("http://localhost:17265/api/tracks/" + id,
                function (data) {
                    // On success, 'data' contains a list of products.
                    $.each(data, function (key, val) {

                        // Format the text to display.
                        var str = val.Name + ': $' + val.PlaceName;

                        // Add a list item for the product.
                        $('<li/>', { text: str })
                        .appendTo($('#products'));
                    });

                });
            });

        });
    </script>
</head>
<body style="height: 163px">
    <form id="form1" runat="server">
    
    <div style="height: 147px">

    <tmp:ControlDisplyingData runat="server" ID="test"></tmp:ControlDisplyingData>

        <asp:Label ID="Label1" runat="server" Text="Provide Id"></asp:Label>
    
        <asp:TextBox ID="TextBox1" runat="server" Height="33px" 
            ontextchanged="TextBox1_TextChanged" 
            style="margin-left: 35px; margin-bottom: 2px" Width="193px"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" onclick="Button1_Click1" 
            Text="Button" />
&nbsp;<ul id="products"/>

    </div>
    </form>
</body>
</html>
